package com.geek.bams.vo;

/**
 * @Desc TODO
 * @Author lirui
 * @Date 2025/10/27
 */
public class RankVO implements Comparable<RankVO>{

    private String personId;
    private String name;
    private double total;

    //按照总资产降序排列，若总资产相同则按照名称升序排列
    @Override
    public int compareTo(RankVO vo) {
        if(this.total==vo.total){
            return this.getName().compareTo(vo.getName());
        }
        //总资产降序排列
        return Double.compare(vo.total, this.total);
    }

    public RankVO() {
    }

    public RankVO(String personId, String name, double total) {
        this.personId = personId;
        this.name = name;
        this.total = total;
    }

    /**
     * 获取
     * @return personId
     */
    public String getPersonId() {
        return personId;
    }

    /**
     * 设置
     * @param personId
     */
    public void setPersonId(String personId) {
        this.personId = personId;
    }

    /**
     * 获取
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取
     * @return total
     */
    public double getTotal() {
        return total;
    }

    /**
     * 设置
     * @param total
     */
    public void setTotal(double total) {
        this.total = total;
    }

    public String toString() {
        return "RankVO{personId = " + personId + ", name = " + name + ", total = " + total + "}";
    }


}
